﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace WPF_DataLogger
{
    public partial class TextBoxContent : INotifyPropertyChanged
    {
        public TextBoxContent()
        {
            text_content = "";
        }

        public TextBoxContent(string new_content)
        {
            text_content = new_content;
        }

        public string Text_content
        {
            get
            {
                return text_content;
            }

            set
            {
                if (value != text_content)
                {
                    text_content = value;
                    // This next line is the only change within this property.
                    Notify("Text_content");
                }
            }
        }

        // This next region of code, is step one (of two) of what you need
        // to implement to support the INotifyPropertyChanged interface.
        // I usually just copy it from a previous piece of code as-is, it just works.
        #region INotifyPropertyChanged members
        public event PropertyChangedEventHandler PropertyChanged;
        protected void Notify(string propertyName)
        {
            if (this.PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
        #endregion




        private string text_content;
    }
}
